import React from "react";
import PropTypes from "prop-types";

function Component({ list, string }) {
  console.log(list);
  return (
    <div>
      { list.map((item) => <p key={item}>{item}</p>) }
      <br />
      { string }
    </div>
  )
}

// eslint-disable-next-line react/no-typos
Component.propTypes = {
  list: PropTypes.array,
  string: PropTypes.string
}

// react类组件
class App extends React.Component {
  // 渲染ui结构
  render() {
    return (
      <>
        <Component list={[1, 2, 3]} string={'1'}></Component>
      </>
    )
  }
}

export default App;
